package com.example.exam.util;

import com.example.exam.vo.ResultVO;

/**
 * @author shishuqian
 * date 2021/4/28
 * time 15:21
 **/
public class ResultVOUtil {

    public static ResultVO success(Object data){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO error(String error){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg(error);
        resultVO.setData(null);
        return resultVO;
    }

    public static ResultVO common(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        resultVO.setData(null);
        return  resultVO;
    }


}
